home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / c2man-2.0pl33.lha / c2man-2.0 / amiga / lex.yy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-24  |  67.9 KB  |  2,566 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* Scanner skeleton version:
  4.  * $Header: flex.skl,v 1.2 94/01/04 14:33:15 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11.  
  12. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  13. #ifdef c_plusplus
  14. #ifndef __cplusplus
  15. #define __cplusplus
  16. #endif
  17. #endif
  18.  
  19.  
  20. #ifdef __cplusplus
  21.  
  22. #include <stdlib.h>
  23. #include <unistd.h>
  24.  
  25. /* Use prototypes in function declarations. */
  26. #define YY_USE_PROTOS
  27.  
  28. /* The "const" storage-class-modifier is valid. */
  29. #define YY_USE_CONST
  30.  
  31. #else    /* ! __cplusplus */
  32.  
  33. #ifdef __STDC__
  34.  
  35. #define YY_USE_PROTOS
  36. #define YY_USE_CONST
  37.  
  38. #endif    /* __STDC__ */
  39. #endif    /* ! __cplusplus */
  40.  
  41.  
  42. #ifdef __TURBOC__
  43. #define YY_USE_CONST
  44. #endif
  45.  
  46.  
  47. #ifndef YY_USE_CONST
  48. #ifndef const
  49. #define const
  50. #endif
  51. #endif
  52.  
  53.  
  54. #ifdef YY_USE_PROTOS
  55. #define YY_PROTO(proto) proto
  56. #else
  57. #define YY_PROTO(proto) ()
  58. #endif
  59.  
  60. /* Returned upon end-of-file. */
  61. #define YY_NULL 0
  62.  
  63. /* Promotes a possibly negative, possibly signed char to an unsigned
  64.  * integer for use as an array index.  If the signed char is negative,
  65.  * we want to instead treat it as an 8-bit unsigned char, hence the
  66.  * double cast.
  67.  */
  68. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  69.  
  70. /* Enter a start condition.  This macro really ought to take a parameter,
  71.  * but we do it the disgusting crufty way forced on us by the ()-less
  72.  * definition of BEGIN.
  73.  */
  74. #define BEGIN yy_start = 1 + 2 *
  75.  
  76. /* Translate the current start state into a value that can be later handed
  77.  * to BEGIN to return to the state.
  78.  */
  79. #define YY_START ((yy_start - 1) / 2)
  80.  
  81. /* Action number for EOF rule of a given start state. */
  82. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  83.  
  84. /* Special action meaning "start processing a new file".  Now included
  85.  * only for backward compatibility with previous versions of flex.
  86.  */
  87. #define YY_NEW_FILE yyrestart( yyin )
  88.  
  89. #define YY_END_OF_BUFFER_CHAR 0
  90.  
  91. /* Size of default input buffer. */
  92. #define YY_BUF_SIZE 16384
  93.  
  94. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  95.  
  96. extern int yyleng;
  97. extern FILE *yyin, *yyout;
  98.  
  99. #ifdef __cplusplus
  100. extern "C" {
  101. #endif
  102.     extern int yywrap YY_PROTO(( void ));
  103. #ifdef __cplusplus
  104.     }
  105. #endif
  106.  
  107. #define EOB_ACT_CONTINUE_SCAN 0
  108. #define EOB_ACT_END_OF_FILE 1
  109. #define EOB_ACT_LAST_MATCH 2
  110.  
  111. /* The funky do-while in the following #define is used to turn the definition
  112.  * int a single C statement (which needs a semi-colon terminator).  This
  113.  * avoids problems with code like:
  114.  *
  115.  *     if ( condition_holds )
  116.  *        yyless( 5 );
  117.  *    else
  118.  *        do_something_else();
  119.  *
  120.  * Prior to using the do-while the compiler would get upset at the
  121.  * "else" because it interpreted the "if" statement as being all
  122.  * done when it reached the ';' after the yyless() call.
  123.  */
  124.  
  125. /* Return all but the first 'n' matched characters back to the input stream. */
  126.  
  127. #define yyless(n) \
  128.     do \
  129.         { \
  130.         /* Undo effects of setting up yytext. */ \
  131.         *yy_cp = yy_hold_char; \
  132.         yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  133.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  134.         } \
  135.     while ( 0 )
  136.  
  137. #define unput(c) yyunput( c, yytext_ptr )
  138.  
  139.  
  140. struct yy_buffer_state
  141.     {
  142.     FILE *yy_input_file;
  143.  
  144.     char *yy_ch_buf;        /* input buffer */
  145.     char *yy_buf_pos;        /* current position in input buffer */
  146.  
  147.     /* Size of input buffer in bytes, not including room for EOB
  148.      * characters.
  149.      */
  150.     int yy_buf_size;
  151.  
  152.     /* Number of characters read into yy_ch_buf, not including EOB
  153.      * characters.
  154.      */
  155.     int yy_n_chars;
  156.  
  157.     /* Whether this is an "interactive" input source; if so, and
  158.      * if we're using stdio for input, then we want to use getc()
  159.      * instead of fread(), to make sure we stop fetching input after
  160.      * each newline.
  161.      */
  162.     int yy_is_interactive;
  163.  
  164.     /* Whether to try to fill the input buffer when we reach the
  165.      * end of it.
  166.      */
  167.     int yy_fill_buffer;
  168.  
  169.     /* Whether we've seen an EOF on this buffer. */
  170.     int yy_eof_status;
  171. #define EOF_NOT_SEEN 0
  172.     /* "Pending" happens when the EOF has been seen but there's still
  173.      * some text to process.  Note that when we actually see the EOF,
  174.      * we switch the status back to "not seen" (via yyrestart()), so
  175.      * that the user can continue scanning by just pointing yyin at
  176.      * a new input file.
  177.      */
  178. #define EOF_PENDING 1
  179.     };
  180.  
  181. static YY_BUFFER_STATE yy_current_buffer = 0;
  182.  
  183. /* We provide macros for accessing buffer states in case in the
  184.  * future we want to put the buffer states in a more general
  185.  * "scanner state".
  186.  */
  187. #define YY_CURRENT_BUFFER yy_current_buffer
  188.  
  189.  
  190. /* yy_hold_char holds the character lost when yytext is formed. */
  191. static char yy_hold_char;
  192.  
  193. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  194.  
  195.  
  196. int yyleng;
  197.  
  198. /* Points to current character in buffer. */
  199. static char *yy_c_buf_p = (char *) 0;
  200. static int yy_init = 1;        /* whether we need to initialize */
  201. static int yy_start = 0;    /* start state number */
  202.  
  203. /* Flag which is used to allow yywrap()'s to do buffer switches
  204.  * instead of setting up a fresh yyin.  A bit of a hack ...
  205.  */
  206. static int yy_did_buffer_switch_on_eof;
  207.  
  208. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  209. void yyrestart YY_PROTO(( FILE *input_file ));
  210. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  211. void yy_load_buffer_state YY_PROTO(( void ));
  212. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  213. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  214. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  215.  
  216. static int yy_start_stack_ptr = 0;
  217. static int yy_start_stack_depth = 0;
  218. static int *yy_start_stack = 0;
  219. static void yy_push_state YY_PROTO(( int new_state ));
  220. static void yy_pop_state YY_PROTO(( void ));
  221. static int yy_top_state YY_PROTO(( void ));
  222.  
  223. #ifndef yytext_ptr
  224. static void yy_flex_strcpy YY_PROTO(( char *, const char * ));
  225. #endif
  226.  
  227. static void *yy_flex_alloc YY_PROTO(( unsigned int ));
  228. static void *yy_flex_realloc YY_PROTO(( void *ptr, unsigned int ));
  229. static void yy_flex_free YY_PROTO(( void * ));
  230.  
  231. #define yy_new_buffer yy_create_buffer
  232.  
  233. #define INITIAL 0
  234. #define CPP1 1
  235. #define INIT1 2
  236. #define INIT2 3
  237. #define CURLY 4
  238. #define SQUARE 5
  239. #define LEXYACC 6
  240. #define SKIP 7
  241. #define COMMENT 8
  242. #define COMMLINE 9
  243. #define CPPCOMMENT 10
  244. typedef unsigned char YY_CHAR;
  245. typedef int yy_state_type;
  246. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  247. extern char *yytext;
  248. #define yytext_ptr yytext
  249.  
  250. #ifdef __cplusplus
  251. static int yyinput YY_PROTO(( void ));
  252. #else
  253. static int input YY_PROTO(( void ));
  254. #endif
  255.  
  256. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  257. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  258. static int yy_get_next_buffer YY_PROTO(( void ));
  259. static void yy_fatal_error YY_PROTO(( const char msg[] ));
  260.  
  261. /* Done after the current pattern has been matched and before the
  262.  * corresponding action - sets up yytext.
  263.  */
  264. #define YY_DO_BEFORE_ACTION \
  265.     yytext_ptr = yy_bp; \
  266.     yyleng = yy_cp - yy_bp; \
  267.     yy_hold_char = *yy_cp; \
  268.     *yy_cp = '\0'; \
  269.     yy_c_buf_p = yy_cp;
  270.  
  271. #define YY_END_OF_BUFFER 102
  272. static const short int yy_accept[429] =
  273.     {   0,
  274.         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  275.         0,    0,    0,    0,    0,    0,   89,   89,    0,    0,
  276.        95,   95,  102,  100,   98,   99,  100,   14,   15,   16,
  277.        17,  100,  100,   18,   57,   56,   72,   56,   56,   56,
  278.        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
  279.        56,   56,   56,   66,   67,   98,    6,  100,  100,   13,
  280.        13,   13,   13,   13,   13,   61,   61,   61,   61,   59,
  281.        61,   61,   58,   61,   61,   65,   65,   65,   65,   65,
  282.        65,   62,   63,   65,   65,   71,   71,   71,   71,   71,
  283.        71,   68,   69,   71,   71,   75,   75,   75,   75,   75,
  284.  
  285.        73,   75,   74,   75,   75,    4,    4,    4,    4,    4,
  286.         4,    4,    4,    4,   17,   66,   67,   89,   90,   92,
  287.        89,   91,   83,   83,   84,   82,   81,   82,   82,   82,
  288.        80,   95,   95,   97,   98,    0,   20,    0,    0,    0,
  289.        94,   56,   56,   56,   56,   56,   56,   56,   56,   56,
  290.        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
  291.        56,   56,   56,   56,   98,    6,    0,    6,    5,    0,
  292.        93,    0,    0,   12,    0,    0,    0,    0,    0,   60,
  293.         0,    0,    0,   98,    0,   64,    0,    0,    0,    0,
  294.        70,    0,    0,    0,    0,   75,    0,    0,    0,    0,
  295.  
  296.         3,    0,    0,    0,    1,    2,   89,   90,   92,    0,
  297.        89,   91,   91,   88,   82,   81,   82,   82,   80,   81,
  298.        80,   95,   95,    0,    0,   19,   79,   78,   79,   94,
  299.        94,   56,   56,   56,   56,   56,   56,   56,   56,   56,
  300.        56,   56,   56,   50,   56,   56,   56,   29,   56,   56,
  301.        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
  302.        56,    0,   93,   77,   76,   77,   93,   93,    0,    0,
  303.         0,    0,   60,   64,   70,   75,    3,    0,   87,   81,
  304.        80,   96,   78,   56,   56,   56,   56,   56,   21,   56,
  305.        26,   56,   56,   37,   56,   56,   51,   56,   56,   31,
  306.  
  307.        53,   56,   56,   56,   56,   56,   56,   56,   56,   56,
  308.        30,   56,   77,   76,   77,   93,   93,   76,    0,   11,
  309.         0,    0,    0,    0,    0,   96,   96,   56,   56,   56,
  310.        56,   56,   49,   40,   56,   56,   28,   56,   56,   56,
  311.        56,   32,   56,   56,   56,   56,   39,   56,   56,   76,
  312.         0,    0,    0,    0,   56,   56,   56,   56,   56,   27,
  313.        22,   46,   56,   54,   56,   33,   24,   38,   56,   56,
  314.        56,    0,    0,    0,   86,   85,   86,   42,   56,   56,
  315.        56,   56,   56,   56,   25,   56,   56,    0,    0,    0,
  316.        85,   56,   56,   48,   35,   56,   56,   23,   36,   43,
  317.  
  318.         7,    0,    0,    0,    0,   41,   56,   56,   56,   56,
  319.        52,    7,    0,    0,    0,   10,   56,   47,   34,   45,
  320.         8,    9,   56,   56,   56,   44,   55,    0
  321.     } ;
  322.  
  323. static const int yy_ec[256] =
  324.     {   0,
  325.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  326.         1,    4,    1,    1,    1,    1,    1,    1,    1,    1,
  327.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  328.         1,    2,    1,    5,    6,    1,    7,    1,    8,    9,
  329.        10,   11,    1,   12,    1,   13,   14,   15,   15,   15,
  330.        15,   15,   15,   15,   15,   15,   15,    1,   16,   17,
  331.        18,   19,    1,    1,   20,   20,   20,   20,   20,   20,
  332.        20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
  333.        20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
  334.        21,   22,   23,    1,   24,    1,   25,   26,   27,   28,
  335.  
  336.        29,   30,   31,   32,   33,   20,   20,   34,   35,   36,
  337.        37,   38,   20,   39,   40,   41,   42,   43,   20,   44,
  338.        45,   20,   46,    1,   47,    1,    1,    1,    1,    1,
  339.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  340.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  341.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  342.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  343.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  344.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  345.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  346.  
  347.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  348.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  349.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  350.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  351.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  352.         1,    1,    1,    1,    1
  353.     } ;
  354.  
  355. static const int yy_meta[48] =
  356.     {   0,
  357.         1,    2,    3,    1,    4,    1,    1,    1,    1,    1,
  358.         5,    1,    1,    6,    7,    1,    1,    1,    8,    9,
  359.         1,    1,    1,    9,    9,    9,    9,    9,    9,    9,
  360.         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
  361.         9,    9,    9,    9,    9,    1,    1
  362.     } ;
  363.  
  364. static const short int yy_base[471] =
  365.     {   0,
  366.         0,   46,   47,   54,   87,  132,  177,  223,  269,  315,
  367.       361,  383,   62,  405,  426,   57,   75,   94,   70,  104,
  368.       108,  117,  984,  985,   59,  985,   63,  985,  985,  985,
  369.       985,  970,  102,  985,  985,    0,  985,  958,  939,   94,
  370.       943,   58,   89,  937,  942,  940,  947,  950,  945,   97,
  371.       928,  936,  934,  985,  985,  137,  968,  922,  113,  985,
  372.       143,  147,  939,  931,  933,  985,  151,   78,  120,  985,
  373.       145,    0,  985,  156,  150,  985,  161,  147,  149,  161,
  374.         0,  985,  985,  172,  173,  985,  164,  168,  175,  178,
  375.         0,  985,  985,  191,  187,  985,  192,  195,  180,  192,
  376.  
  377.       985,    0,  985,  205,  197,  985,  208,  199,  207,  202,
  378.         0,  216,   47,  221,  985,  985,  985,    0,  236,  985,
  379.       232,  230,  985,  244,  985,  985,  247,  985,  248,  251,
  380.       252,    0,  253,  254,  274,  237,  985,    0,  952,  273,
  381.       278,    0,  261,  923,  934,  937,  925,  918,  917,  917,
  382.       918,  919,  924,   91,  918,  928,  912,  920,  913,  918,
  383.       242,  910,  246,  262,  296,  945,  271,  944,  985,  295,
  384.       297,  942,  319,  985,  310,  914,  916,  906,  238,  985,
  385.         0,  285,  306,  328,  304,  985,    0,  319,  323,  328,
  386.       985,    0,  326,  327,  331,  985,    0,  330,  332,  334,
  387.  
  388.       985,    0,  335,  336,  985,  985,    0,  368,  985,  362,
  389.       301,  363,  367,  344,  985,  388,  391,  387,  409,  939,
  390.       938,    0,  392,  353,  925,  985,  985,  936,  349,  935,
  391.       422,  899,  891,  898,  900,  895,  894,  903,  890,  888,
  392.       901,  891,  896,    0,  899,  894,  889,  892,  889,  880,
  393.       891,  884,  877,  879,  873,  871,  883,  874,  877,  881,
  394.       883,  357,  430,  985,  905,  414,  904,  435,  902,  871,
  395.       869,  873,  392,  395,  413,  431,  434,  448,  441,  899,
  396.       898,  443,  897,  862,  856,  862,  864,  860,    0,  859,
  397.         0,  851,  857,    0,  851,  848,    0,  852,  848,    0,
  398.  
  399.         0,  861,  845,  843,  854,  849,  854,  852,  843,  847,
  400.         0,  836,  985,  874,  450,  873,  456,  872,  870,  985,
  401.       836,  829,  868,  445,  858,  866,  460,  827,  837,  832,
  402.       828,  838,    0,    0,  833,  825,    0,  831,  820,  814,
  403.       794,    0,  802,  800,  785,  796,    0,  788,  790,  820,
  404.       788,  771,  102,  458,  749,  745,  733,  722,  703,    0,
  405.         0,    0,  700,    0,  712,    0,    0,    0,  703,  695,
  406.       672,  695,  650,  461,  985,  668,  464,  628,  603,  596,
  407.       588,  561,  454,  452,    0,  462,  460,  486,  463,  413,
  408.       485,  462,  452,  460,  459,  448,  438,    0,    0,    0,
  409.  
  410.         0,  476,    0,    0,  474,    0,  427,  402,  398,  351,
  411.         0,    0,  282,  245,  230,  985,  186,    0,    0,  190,
  412.       985,  985,  153,  143,   31,    0,    0,  985,  493,  502,
  413.       511,  520,  529,  538,  547,  556,  565,  574,  583,  586,
  414.       595,  604,  613,  622,  631,  640,  649,  658,  667,  676,
  415.       685,  694,  703,  712,  721,  730,  739,  748,  757,  766,
  416.       775,  784,  793,  802,  811,  819,  822,  831,  840,  849
  417.     } ;
  418.  
  419. static const short int yy_def[471] =
  420.     {   0,
  421.       428,    1,  429,  429,  430,  430,  431,  431,  432,  432,
  422.       433,  433,  434,  434,  432,   15,  435,  435,  436,  437,
  423.       438,  438,  428,  428,  428,  428,  439,  428,  428,  428,
  424.       428,  428,  428,  428,  428,  440,  428,  440,  440,  440,
  425.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  426.       440,  440,  440,  428,  428,  428,  428,  428,  428,  428,
  427.       428,  441,  428,  428,  428,  428,  428,  442,  443,  428,
  428.       428,  444,  428,  428,  428,  428,  428,  445,  446,  428,
  429.       447,  428,  428,  428,  428,  428,  428,  448,  449,  428,
  430.       450,  428,  428,  428,  428,  428,  428,  451,  452,  428,
  431.  
  432.       428,  453,  428,  428,  428,  428,  428,  454,  455,  428,
  433.       456,  428,  428,  428,  428,  428,  428,  457,  428,  428,
  434.       457,  458,  428,  428,  428,  428,  459,  428,  428,  459,
  435.       459,  460,  460,  428,  428,  439,  428,  439,  428,  461,
  436.       428,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  437.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  438.       440,  440,  440,  440,  428,  428,  428,  428,  428,  462,
  439.       428,  441,  441,  428,  441,  428,  428,  428,  442,  428,
  440.       442,  443,  443,  428,  445,  428,  445,  446,  446,  448,
  441.       428,  448,  449,  449,  451,  428,  451,  452,  452,  454,
  442.  
  443.       428,  454,  455,  455,  428,  428,  457,  428,  428,  428,
  444.       457,  458,  458,  428,  428,  459,  428,  459,  459,  428,
  445.       428,  460,  460,  428,  428,  428,  428,  428,  461,  428,
  446.       428,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  447.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  448.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  449.       440,  463,  428,  428,  428,  462,  428,  428,  464,  428,
  450.       428,  428,  443,  446,  449,  452,  455,  428,  428,  428,
  451.       428,  428,  428,  440,  440,  440,  440,  440,  440,  440,
  452.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  453.  
  454.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  455.       440,  440,  428,  428,  463,  428,  428,  428,  464,  428,
  456.       428,  428,  428,  428,  428,  428,  428,  440,  440,  440,
  457.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  458.       440,  440,  440,  440,  440,  440,  440,  440,  440,  428,
  459.       428,  428,  428,  465,  440,  440,  440,  440,  440,  440,
  460.       440,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  461.       440,  428,  428,  428,  428,  428,  465,  440,  440,  440,
  462.       440,  440,  440,  440,  440,  440,  440,  466,  428,  428,
  463.       428,  440,  440,  440,  440,  440,  440,  440,  440,  440,
  464.  
  465.       467,  428,  468,  469,  470,  440,  440,  440,  440,  440,
  466.       440,  467,  468,  469,  470,  428,  440,  440,  440,  440,
  467.       428,  428,  440,  440,  440,  440,  440,    0,  428,  428,
  468.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  469.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  470.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  471.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428
  472.     } ;
  473.  
  474. static const short int yy_nxt[1033] =
  475.     {   0,
  476.        24,   25,   26,   25,   27,   24,   24,   24,   28,   29,
  477.        30,   31,   32,   33,   24,   34,   24,   35,   24,   36,
  478.        37,   24,   24,   38,   39,   36,   40,   41,   42,   43,
  479.        36,   44,   45,   46,   36,   47,   36,   48,   49,   50,
  480.        51,   52,   53,   36,   36,   54,   55,   56,   61,   26,
  481.        61,   57,   58,  205,  427,   61,   26,   61,   94,   59,
  482.       135,   62,  135,  107,   26,  107,  108,  137,   62,  109,
  483.        95,  124,  125,  124,   63,  110,  119,  120,  121,   64,
  484.        65,   63,  180,  111,  138,  122,   64,   65,   67,   26,
  485.        67,   68,  206,  149,   69,  119,  120,  121,   70,  181,
  486.  
  487.        71,  150,   70,  353,  122,  127,  128,  129,   72,  133,
  488.       134,  133,  140,  151,  130,  141,  374,  131,  133,  134,
  489.       133,  145,  152,  170,  247,  146,  171,  180,  159,  160,
  490.       147,  248,   73,   74,   26,   67,   68,  161,  165,   69,
  491.       135,  183,  166,   70,  135,   75,  135,   70,  173,  174,
  492.       167,  186,  135,   72,  135,  140,  186,  184,  141,  135,
  493.       170,  175,  135,  171,  135,  135,  426,  135,  187,  167,
  494.       189,  140,  191,  184,  141,  135,  425,   73,   77,   26,
  495.        77,   78,  191,  170,   79,  167,  171,  196,  140,  192,
  496.        80,  141,  184,  135,  135,  135,  194,  170,   81,  196,
  497.  
  498.       171,  199,  140,  201,  167,  141,  184,  170,  135,  135,
  499.       171,  135,  140,  424,  201,  141,  197,  184,  167,  135,
  500.       202,  423,   82,   83,   84,   26,   77,   78,  204,  167,
  501.        79,  170,  416,  135,  171,  211,   85,  208,  209,  135,
  502.       213,  137,  180,  214,   81,  135,  210,  135,  216,  135,
  503.       217,  135,  220,  221,  223,  224,  223,  218,  138,  181,
  504.       219,  218,  218,  422,  428,  219,  255,  225,   82,   83,
  505.        87,   26,   87,   88,  228,  135,   89,  135,  258,  230,
  506.       256,  262,   90,  229,  263,  259,  421,  232,  231,  233,
  507.        91,  231,  180,  234,  260,  261,  265,  165,  267,  135,
  508.  
  509.       235,  166,  135,  236,  211,  266,  183,  268,  186,  167,
  510.       268,  173,  174,  273,   92,   93,   94,   26,   87,   88,
  511.       173,  174,   89,  269,  175,  187,  186,  183,   95,  184,
  512.       274,  135,  191,  191,  275,  196,   91,  196,  201,  276,
  513.       189,  167,  201,  277,  189,  278,  279,  194,  194,  192,
  514.       228,  199,  197,  199,  224,  202,  204,  204,  314,  229,
  515.        92,   93,   97,   26,   97,   98,  225,  315,   99,  208,
  516.       209,  135,  210,  428,  100,  214,  428,  213,  210,  420,
  517.       214,  101,  102,  103,  104,   26,   97,   98,  220,  216,
  518.        99,  217,  135,  223,  135,  223,  105,  218,  218,  180,
  519.  
  520.       428,  219,  186,  101,  102,  103,  112,   26,  107,  108,
  521.       221,  113,  109,  183,  390,  265,  189,  405,  114,  218,
  522.       191,  419,  219,  230,  266,  418,  111,   87,   26,   87,
  523.        88,  316,  231,   89,  194,  231,  267,  115,  196,   90,
  524.       317,  201,  324,  317,  326,  268,  324,   91,  268,  278,
  525.       279,  314,  199,  327,  325,  204,  327,  316,  325,  376,
  526.       315,  326,  390,  417,  402,  376,  317,  403,  377,  317,
  527.       327,  116,  117,  327,  377,  374,  416,  402,  411,  404,
  528.       403,  410,  409,  408,  407,  406,  391,  388,  400,  399,
  529.       398,  397,  404,   60,   60,   60,   60,   60,   60,   60,
  530.  
  531.        60,   60,   66,   66,   66,   66,   66,   66,   66,   66,
  532.        66,   76,   76,   76,   76,   76,   76,   76,   76,   76,
  533.        86,   86,   86,   86,   86,   86,   86,   86,   86,   96,
  534.        96,   96,   96,   96,   96,   96,   96,   96,  106,  106,
  535.       106,  106,  106,  106,  106,  106,  106,  118,  118,  118,
  536.       118,  118,  118,  118,  118,  118,  123,  123,  123,  123,
  537.       123,  123,  123,  123,  123,  126,  126,  126,  126,  126,
  538.       126,  126,  126,  126,  132,  132,  132,  132,  132,  132,
  539.       132,  132,  132,  136,  136,  136,  136,  136,  136,  136,
  540.       136,  136,  142,  396,  142,  172,  172,  172,  172,  172,
  541.  
  542.       172,  172,  172,  172,  179,  179,  179,  179,  179,  179,
  543.       179,  179,  179,  182,  182,  395,  182,  182,  182,  182,
  544.       182,  182,  180,  180,  394,  180,  180,  180,  180,  180,
  545.       180,  185,  185,  185,  185,  185,  185,  185,  185,  185,
  546.       188,  188,  393,  188,  188,  188,  188,  188,  188,  186,
  547.       186,  392,  186,  186,  186,  186,  186,  186,  190,  190,
  548.       190,  190,  190,  190,  190,  190,  190,  193,  193,  391,
  549.       193,  193,  193,  193,  193,  193,  191,  191,  389,  191,
  550.       191,  191,  191,  191,  191,  195,  195,  195,  195,  195,
  551.       195,  195,  195,  195,  198,  198,  388,  198,  198,  198,
  552.  
  553.       198,  198,  198,  196,  196,  387,  196,  196,  196,  196,
  554.       196,  196,  200,  200,  200,  200,  200,  200,  200,  200,
  555.       200,  203,  203,  386,  203,  203,  203,  203,  203,  203,
  556.       201,  201,  385,  201,  201,  201,  201,  201,  201,  207,
  557.       384,  383,  207,  382,  207,  207,  207,  207,  212,  212,
  558.       381,  212,  212,  212,  212,  212,  212,  215,  215,  215,
  559.       215,  215,  215,  215,  215,  215,  222,  222,  380,  222,
  560.       222,  222,  222,  222,  222,  227,  227,  227,  227,  227,
  561.       379,  227,  227,  227,  264,  264,  264,  264,  264,  378,
  562.       264,  264,  264,  313,  313,  313,  313,  313,  373,  313,
  563.  
  564.       313,  313,  319,  319,  319,  319,  319,  319,  319,  319,
  565.       319,  375,  375,  375,  375,  375,  372,  375,  375,  375,
  566.       401,  350,  371,  370,  369,  368,  367,  401,  412,  366,
  567.       412,  413,  413,  413,  365,  413,  413,  413,  413,  413,
  568.       414,  414,  414,  414,  414,  414,  414,  364,  414,  415,
  569.       415,  415,  415,  415,  415,  415,  415,  415,  363,  362,
  570.       361,  360,  359,  358,  357,  356,  355,  326,  354,  353,
  571.       352,  351,  320,  318,  316,  350,  349,  348,  347,  346,
  572.       345,  344,  343,  342,  341,  340,  339,  338,  337,  336,
  573.       335,  334,  333,  332,  331,  330,  329,  328,  283,  281,
  574.  
  575.       280,  323,  322,  321,  320,  267,  318,  312,  311,  310,
  576.       309,  308,  307,  306,  305,  304,  303,  302,  301,  300,
  577.       299,  298,  297,  296,  295,  294,  293,  292,  291,  290,
  578.       289,  288,  287,  286,  285,  284,  230,  283,  282,  281,
  579.       280,  272,  271,  270,  174,  168,  168,  257,  254,  253,
  580.       252,  251,  250,  249,  246,  245,  244,  243,  242,  241,
  581.       240,  239,  238,  237,  226,  178,  177,  176,  169,  168,
  582.       164,  163,  162,  158,  157,  156,  155,  154,  153,  148,
  583.       144,  143,  139,  428,   23,  428,  428,  428,  428,  428,
  584.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  585.  
  586.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  587.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  588.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  589.       428,  428
  590.     } ;
  591.  
  592. static const short int yy_chk[1033] =
  593.     {   0,
  594.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  595.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  596.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  597.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  598.         1,    1,    1,    1,    1,    1,    1,    2,    3,    3,
  599.         3,    2,    2,  113,  425,    4,    4,    4,   16,    2,
  600.        25,    3,   25,   13,   13,   13,   13,   27,    4,   13,
  601.        16,   19,   19,   19,    3,   13,   17,   17,   17,    3,
  602.         3,    4,   68,   13,   27,   17,    4,    4,    5,    5,
  603.         5,    5,  113,   42,    5,   18,   18,   18,    5,   68,
  604.  
  605.         5,   42,    5,  353,   18,   20,   20,   20,    5,   21,
  606.        21,   21,   33,   43,   20,   33,  353,   20,   22,   22,
  607.        22,   40,   43,   59,  154,   40,   59,   69,   50,   50,
  608.        40,  154,    5,    6,    6,    6,    6,   50,   56,    6,
  609.        56,   69,   56,    6,   61,    6,   61,    6,   62,   62,
  610.        56,   78,   67,    6,   67,   71,   79,   74,   71,   74,
  611.        75,   62,   77,   75,   77,   87,  424,   87,   78,   74,
  612.        79,   80,   88,   84,   80,   84,  423,    6,    7,    7,
  613.         7,    7,   89,   85,    7,   84,   85,   99,   90,   88,
  614.         7,   90,   94,   97,   94,   97,   89,   95,    7,   98,
  615.  
  616.        95,   99,  100,  108,   94,  100,  104,  105,  104,  107,
  617.       105,  107,  110,  420,  109,  110,   98,  112,  104,  112,
  618.       108,  417,    7,    7,    8,    8,    8,    8,  109,  112,
  619.         8,  114,  415,  121,  114,  121,    8,  119,  119,  119,
  620.       122,  136,  179,  122,    8,  124,  119,  124,  127,  129,
  621.       127,  129,  130,  131,  133,  134,  133,  127,  136,  179,
  622.       127,  130,  131,  414,  130,  131,  161,  134,    8,    8,
  623.         9,    9,    9,    9,  140,  135,    9,  135,  163,  141,
  624.       161,  167,    9,  140,  167,  163,  413,  143,  141,  143,
  625.         9,  141,  182,  143,  164,  164,  170,  165,  171,  165,
  626.  
  627.       143,  165,  211,  143,  211,  170,  182,  171,  185,  165,
  628.       171,  175,  175,  183,    9,    9,   10,   10,   10,   10,
  629.       173,  173,   10,  173,  175,  185,  188,  183,   10,  184,
  630.       189,  184,  190,  193,  194,  195,   10,  198,  200,  199,
  631.       188,  184,  203,  204,  189,  214,  214,  193,  194,  190,
  632.       229,  198,  195,  199,  224,  200,  203,  204,  262,  229,
  633.        10,   10,   11,   11,   11,   11,  224,  262,   11,  208,
  634.       208,  208,  210,  212,   11,  210,  212,  213,  208,  410,
  635.       213,   11,   11,   11,   12,   12,   12,   12,  218,  216,
  636.        12,  216,  217,  223,  217,  223,   12,  218,  216,  273,
  637.  
  638.       218,  216,  274,   12,   12,   12,   14,   14,   14,   14,
  639.       219,   14,   14,  273,  390,  266,  274,  390,   14,  219,
  640.       275,  409,  219,  231,  266,  408,   14,   15,   15,   15,
  641.        15,  263,  231,   15,  275,  231,  268,   15,  276,   15,
  642.       263,  277,  279,  263,  282,  268,  324,   15,  268,  278,
  643.       278,  315,  276,  282,  279,  277,  282,  317,  324,  354,
  644.       315,  327,  374,  407,  389,  377,  317,  389,  354,  317,
  645.       327,   15,   15,  327,  377,  374,  405,  402,  397,  389,
  646.       402,  396,  395,  394,  393,  392,  391,  388,  387,  386,
  647.       384,  383,  402,  429,  429,  429,  429,  429,  429,  429,
  648.  
  649.       429,  429,  430,  430,  430,  430,  430,  430,  430,  430,
  650.       430,  431,  431,  431,  431,  431,  431,  431,  431,  431,
  651.       432,  432,  432,  432,  432,  432,  432,  432,  432,  433,
  652.       433,  433,  433,  433,  433,  433,  433,  433,  434,  434,
  653.       434,  434,  434,  434,  434,  434,  434,  435,  435,  435,
  654.       435,  435,  435,  435,  435,  435,  436,  436,  436,  436,
  655.       436,  436,  436,  436,  436,  437,  437,  437,  437,  437,
  656.       437,  437,  437,  437,  438,  438,  438,  438,  438,  438,
  657.       438,  438,  438,  439,  439,  439,  439,  439,  439,  439,
  658.       439,  439,  440,  382,  440,  441,  441,  441,  441,  441,
  659.  
  660.       441,  441,  441,  441,  442,  442,  442,  442,  442,  442,
  661.       442,  442,  442,  443,  443,  381,  443,  443,  443,  443,
  662.       443,  443,  444,  444,  380,  444,  444,  444,  444,  444,
  663.       444,  445,  445,  445,  445,  445,  445,  445,  445,  445,
  664.       446,  446,  379,  446,  446,  446,  446,  446,  446,  447,
  665.       447,  378,  447,  447,  447,  447,  447,  447,  448,  448,
  666.       448,  448,  448,  448,  448,  448,  448,  449,  449,  376,
  667.       449,  449,  449,  449,  449,  449,  450,  450,  373,  450,
  668.       450,  450,  450,  450,  450,  451,  451,  451,  451,  451,
  669.       451,  451,  451,  451,  452,  452,  372,  452,  452,  452,
  670.  
  671.       452,  452,  452,  453,  453,  371,  453,  453,  453,  453,
  672.       453,  453,  454,  454,  454,  454,  454,  454,  454,  454,
  673.       454,  455,  455,  370,  455,  455,  455,  455,  455,  455,
  674.       456,  456,  369,  456,  456,  456,  456,  456,  456,  457,
  675.       365,  363,  457,  359,  457,  457,  457,  457,  458,  458,
  676.       358,  458,  458,  458,  458,  458,  458,  459,  459,  459,
  677.       459,  459,  459,  459,  459,  459,  460,  460,  357,  460,
  678.       460,  460,  460,  460,  460,  461,  461,  461,  461,  461,
  679.       356,  461,  461,  461,  462,  462,  462,  462,  462,  355,
  680.       462,  462,  462,  463,  463,  463,  463,  463,  352,  463,
  681.  
  682.       463,  463,  464,  464,  464,  464,  464,  464,  464,  464,
  683.       464,  465,  465,  465,  465,  465,  351,  465,  465,  465,
  684.       466,  350,  349,  348,  346,  345,  344,  466,  467,  343,
  685.       467,  468,  468,  468,  341,  468,  468,  468,  468,  468,
  686.       469,  469,  469,  469,  469,  469,  469,  340,  469,  470,
  687.       470,  470,  470,  470,  470,  470,  470,  470,  339,  338,
  688.       336,  335,  332,  331,  330,  329,  328,  326,  325,  323,
  689.       322,  321,  319,  318,  316,  314,  312,  310,  309,  308,
  690.       307,  306,  305,  304,  303,  302,  299,  298,  296,  295,
  691.       293,  292,  290,  288,  287,  286,  285,  284,  283,  281,
  692.  
  693.       280,  272,  271,  270,  269,  267,  265,  261,  260,  259,
  694.       258,  257,  256,  255,  254,  253,  252,  251,  250,  249,
  695.       248,  247,  246,  245,  243,  242,  241,  240,  239,  238,
  696.       237,  236,  235,  234,  233,  232,  230,  228,  225,  221,
  697.       220,  178,  177,  176,  172,  168,  166,  162,  160,  159,
  698.       158,  157,  156,  155,  153,  152,  151,  150,  149,  148,
  699.       147,  146,  145,  144,  139,   65,   64,   63,   58,   57,
  700.        53,   52,   51,   49,   48,   47,   46,   45,   44,   41,
  701.        39,   38,   32,   23,  428,  428,  428,  428,  428,  428,
  702.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  703.  
  704.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  705.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  706.       428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
  707.       428,  428
  708.     } ;
  709.  
  710. static yy_state_type yy_last_accepting_state;
  711. static char *yy_last_accepting_cpos;
  712.  
  713. /* The intent behind this definition is that it'll catch
  714.  * any uses of REJECT which flex missed.
  715.  */
  716. #define REJECT reject_used_but_not_detected
  717. #define yymore() yymore_used_but_not_detected
  718. #define YY_MORE_ADJ 0
  719. char *yytext;
  720. # line 1 "/lex.l"
  721. # line 2 "/lex.l"
  722. /* $Id: lex.l,v 2.0.1.23 1994/01/21 07:48:57 greyham Exp $
  723.  *
  724.  * C manual page generator
  725.  * Lexical analyzer specification
  726.  */
  727.  
  728. #include <ctype.h>
  729.  
  730. static char *cur_file;            /* current file name (malloced) */
  731. int line_num = 1;        /* current line number in file */
  732. static int curly = 0;        /* number of curly brace nesting levels */
  733. static int square = 0;        /* number of square bracket nesting levels */
  734. static int ly_count = 0;    /* number of occurances of %% */
  735.  
  736. /* temporary string buffer */
  737. static char buf[MAX_TEXT_LENGTH];
  738.  
  739. #define DYNBUF_ALLOC    240    /* size of increment of dynamic buf */
  740. static char *dynbuf;        /* start of dynamic buf */
  741. static int dynbuf_size;        /* number of bytes allocated */
  742. static int dynbuf_current;    /* current end of buffer */
  743.  
  744. static boolean comment_ateol;    /* does comment start & end at end of a line? */
  745. static boolean comment_remember;/* remember contents of current comment? */
  746. static boolean comment_caller;    /* state we were in before */
  747.  
  748. typedef struct {
  749. #ifdef FLEX_SCANNER
  750.     YY_BUFFER_STATE buffer;
  751. #else
  752.     FILE *fp;
  753. #endif
  754.     char *file;
  755.     int line_num;
  756. } IncludeStack;
  757.  
  758. static int inc_depth = 0;            /* include nesting level */
  759. static IncludeStack inc_stack[MAX_INC_DEPTH];    /* stack of included files */
  760.  
  761. static void update_line_num _((void));
  762. static void do_include _((char *filename, int sysinc));
  763. static void new_dynbuf();
  764. static void add_dynbuf _((int c));
  765. static char *return_dynbuf();
  766. static void get_cpp_directive();
  767. static boolean process_line_directive _((const char *new_file));
  768.  
  769. /*
  770.  * The initial comment processing is done primarily by the rather complex lex
  771.  * rules in the various comment start states, the main functions being removal
  772.  * of leading *'s, /'s and whitespace on a line, the removal of trailing
  773.  * whitespace on a line, and the coalescing of separate comments on adjacent
  774.  * lines.  The remaining bits of textual content are collected by the following
  775.  * functions, which simply strip leading and trailing blank lines.
  776.  */
  777. void start_comment _((boolean ateol));
  778. int end_comment _((boolean ateol));
  779. void add_comment _((const char *s));
  780. void newline_comment _((void));
  781.  
  782. static int comment_newlines;    /* number of newlines hit in comment */
  783. static boolean comment_started;    /* have preceeding empty lines been skipped */
  784.  
  785. #ifdef FLEX_SCANNER    /* flex uses YY_START instead of YYSTATE */
  786. #define YYSTATE    YY_START
  787. #ifndef YY_START    /* flex 2.3.8 & before didn't support it at all */
  788. #define YY_START ((yy_start - 1) / 2)
  789. #endif
  790. #endif
  791.  
  792. #undef yywrap    /* for flex */
  793.  
  794. /* SKIP        skipping value assignment in an enum */
  795.  
  796. /* Macros after this point can all be overridden by user definitions in
  797.  * section 1.
  798.  */
  799.  
  800. #ifdef YY_MALLOC_DECL
  801. YY_MALLOC_DECL
  802. #else
  803. #if __STDC__
  804. #ifndef __cplusplus
  805. #include <stdlib.h>
  806. #endif
  807. #else
  808. /* Just try to get by without declaring the routines.  This will fail
  809.  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  810.  * or sizeof(void*) != sizeof(int).
  811.  */
  812. #endif
  813. #endif
  814.  
  815. /* Amount of stuff to slurp up with each read. */
  816. #ifndef YY_READ_BUF_SIZE
  817. #define YY_READ_BUF_SIZE 8192
  818. #endif
  819.  
  820. /* Copy whatever the last rule matched to the standard output. */
  821.  
  822. #ifndef ECHO
  823. /* This used to be an fputs(), but since the string might contain NUL's,
  824.  * we now use fwrite().
  825.  */
  826. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  827. #endif
  828.  
  829. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  830.  * is returned in "result".
  831.  */
  832. #ifndef YY_INPUT
  833. #define YY_INPUT(buf,result,max_size) \
  834.     if ( yy_current_buffer->yy_is_interactive ) \
  835.         { \
  836.         int c = getc( yyin ); \
  837.         result = c == EOF ? 0 : 1; \
  838.         buf[0] = (char) c; \
  839.         } \
  840.     else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
  841.           && ferror( yyin ) ) \
  842.         YY_FATAL_ERROR( "input in flex scanner failed" );
  843. #endif
  844.  
  845. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  846.  * we don't want an extra ';' after the "return" because that will cause
  847.  * some compilers to complain about unreachable statements.
  848.  */
  849. #ifndef yyterminate
  850. #define yyterminate() return YY_NULL
  851. #endif
  852.  
  853. /* Number of entries by which start-condition stack grows. */
  854. #ifndef YY_START_STACK_INCR
  855. #define YY_START_STACK_INCR 25
  856. #endif
  857.  
  858. /* Report a fatal error. */
  859. #ifndef YY_FATAL_ERROR
  860. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  861. #endif
  862.  
  863. /* Default declaration of generated scanner - a define so the user can
  864.  * easily add parameters.
  865.  */
  866. #ifndef YY_DECL
  867. #define YY_DECL int yylex YY_PROTO(( void ))
  868. #endif
  869.  
  870. /* Code executed at the beginning of each rule, after yytext and yyleng
  871.  * have been set up.
  872.  */
  873. #ifndef YY_USER_ACTION
  874. #define YY_USER_ACTION
  875. #endif
  876.  
  877. /* Code executed at the end of each rule. */
  878. #ifndef YY_BREAK
  879. #define YY_BREAK break;
  880. #endif
  881.  
  882. YY_DECL
  883.     {
  884.     register yy_state_type yy_current_state;
  885.     register char *yy_cp, *yy_bp;
  886.     register int yy_act;
  887.  
  888. # line 88 "/lex.l"
  889.  
  890.  
  891.  
  892.  
  893.     if ( yy_init )
  894.         {
  895. #ifdef YY_USER_INIT
  896.         YY_USER_INIT;
  897. #endif
  898.  
  899.         if ( ! yy_start )
  900.             yy_start = 1;    /* first start state */
  901.  
  902.         if ( ! yyin )
  903.             yyin = stdin;
  904.  
  905.         if ( ! yyout )
  906.             yyout = stdout;
  907.  
  908.         if ( yy_current_buffer )
  909.             yy_init_buffer( yy_current_buffer, yyin );
  910.         else
  911.             yy_current_buffer =
  912.                 yy_create_buffer( yyin, YY_BUF_SIZE );
  913.  
  914.         yy_load_buffer_state();
  915.  
  916.         yy_init = 0;
  917.         }
  918.  
  919.     while ( 1 )        /* loops until end-of-file is reached */
  920.         {
  921.         yy_cp = yy_c_buf_p;
  922.  
  923.         /* Support of yytext. */
  924.         *yy_cp = yy_hold_char;
  925.  
  926.         /* yy_bp points to the position in yy_ch_buf of the start of
  927.          * the current run.
  928.          */
  929.         yy_bp = yy_cp;
  930.  
  931.         yy_current_state = yy_start;
  932.         if ( yy_bp[-1] == '\n' )
  933.             ++yy_current_state;
  934. yy_match:
  935.         do
  936.             {
  937.             register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  938.             if ( yy_accept[yy_current_state] )
  939.                 {
  940.                 yy_last_accepting_state = yy_current_state;
  941.                 yy_last_accepting_cpos = yy_cp;
  942.                 }
  943.             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  944.                 {
  945.                 yy_current_state = (int) yy_def[yy_current_state];
  946.                 if ( yy_current_state >= 429 )
  947.                     yy_c = yy_meta[(unsigned int) yy_c];
  948.                 }
  949.             yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  950.             ++yy_cp;
  951.             }
  952.         while ( yy_base[yy_current_state] != 985 );
  953.  
  954. yy_find_action:
  955.         yy_act = yy_accept[yy_current_state];
  956.  
  957.         YY_DO_BEFORE_ACTION;
  958.  
  959.  
  960. do_action:    /* This label is used only to access EOF actions. */
  961.  
  962.  
  963.         switch ( yy_act )
  964.     { /* beginning of action switch */
  965.             case 0: /* must back up */
  966.             /* undo the effects of YY_DO_BEFORE_ACTION */
  967.             *yy_cp = yy_hold_char;
  968.             yy_cp = yy_last_accepting_cpos;
  969.             yy_current_state = yy_last_accepting_state;
  970.             goto yy_find_action;
  971.  
  972. case 1:
  973. YY_USER_ACTION
  974. # line 91 "/lex.l"
  975. {
  976.                 if (++ly_count >= 2)
  977.                 BEGIN INITIAL;
  978.             }
  979.     YY_BREAK
  980. case 2:
  981. YY_USER_ACTION
  982. # line 95 "/lex.l"
  983. BEGIN INITIAL;
  984.     YY_BREAK
  985. case 3:
  986. YY_USER_ACTION
  987. # line 96 "/lex.l"
  988. update_line_num();
  989.     YY_BREAK
  990. case 4:
  991. YY_USER_ACTION
  992. # line 97 "/lex.l"
  993. ;
  994.     YY_BREAK
  995. case 5:
  996. YY_USER_ACTION
  997. # line 98 "/lex.l"
  998. BEGIN LEXYACC;
  999.     YY_BREAK
  1000. case 6:
  1001. YY_USER_ACTION
  1002. # line 100 "/lex.l"
  1003. BEGIN CPP1;
  1004.     YY_BREAK
  1005. case 7:
  1006. YY_USER_ACTION
  1007. # line 102 "/lex.l"
  1008. {
  1009.                 sscanf(yytext, "define %s", buf);
  1010.                 get_cpp_directive();
  1011.                 new_symbol(typedef_names, buf, DS_EXTERN);
  1012.             }
  1013.     YY_BREAK
  1014. case 8:
  1015. YY_USER_ACTION
  1016. # line 108 "/lex.l"
  1017. {
  1018.                 sscanf(yytext, "include \"%[^\"]\"", buf);
  1019.                 get_cpp_directive();
  1020.                 do_include(buf, FALSE);
  1021.             }
  1022.     YY_BREAK
  1023. case 9:
  1024. YY_USER_ACTION
  1025. # line 113 "/lex.l"
  1026. {
  1027.                 sscanf(yytext, "include <%[^>]>", buf);
  1028.                 get_cpp_directive();
  1029.                 do_include(buf, TRUE);
  1030.             }
  1031.     YY_BREAK
  1032. case 10:
  1033. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  1034. yy_c_buf_p = yy_cp -= 1;
  1035. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1036. YY_USER_ACTION
  1037. # line 119 "/lex.l"
  1038. {
  1039.                 sscanf(yytext, "line %d \"%[^\"]\"",
  1040.                     &line_num, buf);
  1041.                 --line_num;
  1042.                 BEGIN INITIAL;
  1043.  
  1044.                 if (process_line_directive(buf))
  1045.                 return T_BASEFILE;
  1046.             }
  1047.     YY_BREAK
  1048. case 11:
  1049. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  1050. yy_c_buf_p = yy_cp -= 1;
  1051. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1052. YY_USER_ACTION
  1053. # line 128 "/lex.l"
  1054. {
  1055.                 sscanf(yytext, "%d \"%[^\"]\"", &line_num, buf);
  1056.                 --line_num;
  1057.                 BEGIN INITIAL;
  1058.  
  1059.                 if (process_line_directive(buf))
  1060.                 return T_BASEFILE;
  1061.             }
  1062.     YY_BREAK
  1063. case 12:
  1064. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  1065. yy_c_buf_p = yy_cp -= 1;
  1066. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1067. YY_USER_ACTION
  1068. # line 136 "/lex.l"
  1069. {
  1070.                 sscanf(yytext, "%d ", &line_num);
  1071.                 --line_num;
  1072.                 BEGIN INITIAL;
  1073.             }
  1074.     YY_BREAK
  1075. case 13:
  1076. YY_USER_ACTION
  1077. # line 142 "/lex.l"
  1078. get_cpp_directive();
  1079.     YY_BREAK
  1080. case 14:
  1081. YY_USER_ACTION
  1082. # line 144 "/lex.l"
  1083. return '(';
  1084.     YY_BREAK
  1085. case 15:
  1086. YY_USER_ACTION
  1087. # line 145 "/lex.l"
  1088. return ')';
  1089.     YY_BREAK
  1090. case 16:
  1091. YY_USER_ACTION
  1092. # line 146 "/lex.l"
  1093. return '*';
  1094.     YY_BREAK
  1095. case 17:
  1096. YY_USER_ACTION
  1097. # line 147 "/lex.l"
  1098. {
  1099.                 BEGIN INITIAL;    /* stop skipping */
  1100.                 return ',';
  1101.             }
  1102.     YY_BREAK
  1103. case 18:
  1104. YY_USER_ACTION
  1105. # line 151 "/lex.l"
  1106. return ';';
  1107.     YY_BREAK
  1108. case 19:
  1109. YY_USER_ACTION
  1110. # line 152 "/lex.l"
  1111. return T_ELLIPSIS;
  1112.     YY_BREAK
  1113. case 20:
  1114. YY_USER_ACTION
  1115. # line 153 "/lex.l"
  1116. { update_line_num(); return T_STRING_LITERAL; }
  1117.     YY_BREAK
  1118. case 21:
  1119. YY_USER_ACTION
  1120. # line 155 "/lex.l"
  1121. return T_AUTO;
  1122.     YY_BREAK
  1123. case 22:
  1124. YY_USER_ACTION
  1125. # line 156 "/lex.l"
  1126. return T_EXTERN;
  1127.     YY_BREAK
  1128. case 23:
  1129. YY_USER_ACTION
  1130. # line 157 "/lex.l"
  1131. return T_REGISTER;
  1132.     YY_BREAK
  1133. case 24:
  1134. YY_USER_ACTION
  1135. # line 158 "/lex.l"
  1136. return T_STATIC;
  1137.     YY_BREAK
  1138. case 25:
  1139. YY_USER_ACTION
  1140. # line 159 "/lex.l"
  1141. return T_TYPEDEF;
  1142.     YY_BREAK
  1143. case 26:
  1144. YY_USER_ACTION
  1145. # line 160 "/lex.l"
  1146. return T_CHAR;
  1147.     YY_BREAK
  1148. case 27:
  1149. YY_USER_ACTION
  1150. # line 161 "/lex.l"
  1151. return T_DOUBLE;
  1152.     YY_BREAK
  1153. case 28:
  1154. YY_USER_ACTION
  1155. # line 162 "/lex.l"
  1156. return T_FLOAT;
  1157.     YY_BREAK
  1158. case 29:
  1159. YY_USER_ACTION
  1160. # line 163 "/lex.l"
  1161. return T_INT;
  1162.     YY_BREAK
  1163. case 30:
  1164. YY_USER_ACTION
  1165. # line 164 "/lex.l"
  1166. return T_VOID;
  1167.     YY_BREAK
  1168. case 31:
  1169. YY_USER_ACTION
  1170. # line 165 "/lex.l"
  1171. return T_LONG;
  1172.     YY_BREAK
  1173. case 32:
  1174. YY_USER_ACTION
  1175. # line 166 "/lex.l"
  1176. return T_SHORT;
  1177.     YY_BREAK
  1178. case 33:
  1179. YY_USER_ACTION
  1180. # line 167 "/lex.l"
  1181. return T_SIGNED;
  1182.     YY_BREAK
  1183. case 34:
  1184. YY_USER_ACTION
  1185. # line 168 "/lex.l"
  1186. return T_SIGNED;
  1187.     YY_BREAK
  1188. case 35:
  1189. YY_USER_ACTION
  1190. # line 169 "/lex.l"
  1191. return T_SIGNED;
  1192.     YY_BREAK
  1193. case 36:
  1194. YY_USER_ACTION
  1195. # line 170 "/lex.l"
  1196. return T_UNSIGNED;
  1197.     YY_BREAK
  1198. case 37:
  1199. YY_USER_ACTION
  1200. # line 171 "/lex.l"
  1201. { enum_state = KEYWORD; return T_ENUM; }
  1202.     YY_BREAK
  1203. case 38:
  1204. YY_USER_ACTION
  1205. # line 172 "/lex.l"
  1206. return T_STRUCT;
  1207.     YY_BREAK
  1208. case 39:
  1209. YY_USER_ACTION
  1210. # line 173 "/lex.l"
  1211. return T_UNION;
  1212.     YY_BREAK
  1213. case 40:
  1214. YY_USER_ACTION
  1215. # line 174 "/lex.l"
  1216. return T_CONST;
  1217.     YY_BREAK
  1218. case 41:
  1219. YY_USER_ACTION
  1220. # line 175 "/lex.l"
  1221. return T_CONST;
  1222.     YY_BREAK
  1223. case 42:
  1224. YY_USER_ACTION
  1225. # line 176 "/lex.l"
  1226. return T_CONST;
  1227.     YY_BREAK
  1228. case 43:
  1229. YY_USER_ACTION
  1230. # line 177 "/lex.l"
  1231. return T_VOLATILE;
  1232.     YY_BREAK
  1233. case 44:
  1234. YY_USER_ACTION
  1235. # line 178 "/lex.l"
  1236. return T_VOLATILE;
  1237.     YY_BREAK
  1238. case 45:
  1239. YY_USER_ACTION
  1240. # line 179 "/lex.l"
  1241. return T_VOLATILE;
  1242.     YY_BREAK
  1243. case 46:
  1244. YY_USER_ACTION
  1245. # line 180 "/lex.l"
  1246. return T_INLINE;
  1247.     YY_BREAK
  1248. case 47:
  1249. YY_USER_ACTION
  1250. # line 181 "/lex.l"
  1251. return T_INLINE;
  1252.     YY_BREAK
  1253. case 48:
  1254. YY_USER_ACTION
  1255. # line 182 "/lex.l"
  1256. return T_INLINE;
  1257.     YY_BREAK
  1258. case 49:
  1259. YY_USER_ACTION
  1260. # line 183 "/lex.l"
  1261. return T_CDECL;
  1262.     YY_BREAK
  1263. case 50:
  1264. YY_USER_ACTION
  1265. # line 184 "/lex.l"
  1266. return T_FAR;
  1267.     YY_BREAK
  1268. case 51:
  1269. YY_USER_ACTION
  1270. # line 185 "/lex.l"
  1271. return T_HUGE;
  1272.     YY_BREAK
  1273. case 52:
  1274. YY_USER_ACTION
  1275. # line 186 "/lex.l"
  1276. return T_INTERRUPT;
  1277.     YY_BREAK
  1278. case 53:
  1279. YY_USER_ACTION
  1280. # line 187 "/lex.l"
  1281. return T_NEAR;
  1282.     YY_BREAK
  1283. case 54:
  1284. YY_USER_ACTION
  1285. # line 188 "/lex.l"
  1286. return T_PASCAL;
  1287.     YY_BREAK
  1288. case 55:
  1289. YY_USER_ACTION
  1290. # line 189 "/lex.l"
  1291. ;
  1292.     YY_BREAK
  1293. case 56:
  1294. YY_USER_ACTION
  1295. # line 191 "/lex.l"
  1296. {
  1297.                 if (enum_state == BRACES)    BEGIN SKIP;
  1298.                 yylval.text = strduplicate(yytext);
  1299.                 if (is_typedef_name(yytext))
  1300.                 return T_TYPEDEF_NAME;
  1301.                 else
  1302.                 return T_IDENTIFIER;
  1303.             }
  1304.     YY_BREAK
  1305. case 57:
  1306. YY_USER_ACTION
  1307. # line 200 "/lex.l"
  1308. BEGIN INIT1;
  1309.     YY_BREAK
  1310. case 58:
  1311. YY_USER_ACTION
  1312. # line 201 "/lex.l"
  1313. { curly = 1; BEGIN INIT2; }
  1314.     YY_BREAK
  1315. case 59:
  1316. YY_USER_ACTION
  1317. # line 202 "/lex.l"
  1318. {
  1319.                 unput(yytext[yyleng-1]);
  1320.                 BEGIN INITIAL;
  1321.                 return T_INITIALIZER;
  1322.             }
  1323.     YY_BREAK
  1324. case 60:
  1325. YY_USER_ACTION
  1326. # line 207 "/lex.l"
  1327. update_line_num();
  1328.     YY_BREAK
  1329. case 61:
  1330. YY_USER_ACTION
  1331. # line 208 "/lex.l"
  1332. ;
  1333.     YY_BREAK
  1334. case 62:
  1335. YY_USER_ACTION
  1336. # line 210 "/lex.l"
  1337. ++curly;
  1338.     YY_BREAK
  1339. case 63:
  1340. YY_USER_ACTION
  1341. # line 211 "/lex.l"
  1342. {
  1343.                 if (--curly == 0) {
  1344.                 BEGIN INITIAL;
  1345.                 return T_INITIALIZER;
  1346.                 }
  1347.             }
  1348.     YY_BREAK
  1349. case 64:
  1350. YY_USER_ACTION
  1351. # line 217 "/lex.l"
  1352. update_line_num();
  1353.     YY_BREAK
  1354. case 65:
  1355. YY_USER_ACTION
  1356. # line 218 "/lex.l"
  1357. ;
  1358.     YY_BREAK
  1359. case 66:
  1360. YY_USER_ACTION
  1361. # line 220 "/lex.l"
  1362. {
  1363.                 if (enum_state == KEYWORD)
  1364.                 {
  1365.                 enum_state = BRACES;
  1366.                 return '{';
  1367.                 }
  1368.                 else
  1369.                 {
  1370.                 curly = 1;
  1371.                 BEGIN CURLY;
  1372.                 }
  1373.             }
  1374.     YY_BREAK
  1375. case 67:
  1376. YY_USER_ACTION
  1377. # line 232 "/lex.l"
  1378. {
  1379.                  BEGIN INITIAL;    /* stop skipping */
  1380.                 return '}';
  1381.             }
  1382.     YY_BREAK
  1383. case 68:
  1384. YY_USER_ACTION
  1385. # line 237 "/lex.l"
  1386. ++curly;
  1387.     YY_BREAK
  1388. case 69:
  1389. YY_USER_ACTION
  1390. # line 238 "/lex.l"
  1391. {
  1392.                 if (--curly == 0) {
  1393.                 BEGIN INITIAL;
  1394.                 return T_BRACES;
  1395.                 }
  1396.             }
  1397.     YY_BREAK
  1398. case 70:
  1399. YY_USER_ACTION
  1400. # line 244 "/lex.l"
  1401. update_line_num();
  1402.     YY_BREAK
  1403. case 71:
  1404. YY_USER_ACTION
  1405. # line 245 "/lex.l"
  1406. ;
  1407.     YY_BREAK
  1408. case 72:
  1409. YY_USER_ACTION
  1410. # line 247 "/lex.l"
  1411. {
  1412.               new_dynbuf(); add_dynbuf(yytext[0]);
  1413.               square = 1; BEGIN SQUARE;
  1414.             }
  1415.     YY_BREAK
  1416. case 73:
  1417. YY_USER_ACTION
  1418. # line 251 "/lex.l"
  1419. { ++square; add_dynbuf(yytext[0]); }
  1420.     YY_BREAK
  1421. case 74:
  1422. YY_USER_ACTION
  1423. # line 252 "/lex.l"
  1424. {
  1425.                 add_dynbuf(yytext[0]);
  1426.                 if (--square == 0) {
  1427.                 BEGIN INITIAL;
  1428.                 yylval.text = return_dynbuf();
  1429.                 return T_BRACKETS;
  1430.                 }
  1431.             }
  1432.     YY_BREAK
  1433. case 75:
  1434. YY_USER_ACTION
  1435. # line 260 "/lex.l"
  1436. {
  1437.                 int i;
  1438.                 for (i = 0; i < yyleng; ++i)
  1439.                 {
  1440.                 if (yytext[i] == '\n') ++line_num;
  1441.                 add_dynbuf(yytext[i]);
  1442.                 }
  1443.             }
  1444.     YY_BREAK
  1445. case 76:
  1446. YY_USER_ACTION
  1447. # line 269 "/lex.l"
  1448. {
  1449.                 comment_caller = YYSTATE;
  1450.                 start_comment(FALSE);
  1451.                 BEGIN COMMENT; }
  1452.     YY_BREAK
  1453. case 77:
  1454. YY_USER_ACTION
  1455. # line 273 "/lex.l"
  1456. {
  1457.                 yyless(yyleng-1);
  1458.                 comment_caller = YYSTATE;
  1459.                 start_comment(FALSE);
  1460.                 BEGIN COMMENT; }
  1461.     YY_BREAK
  1462. case 78:
  1463. YY_USER_ACTION
  1464. # line 278 "/lex.l"
  1465. {
  1466.                 comment_caller = YYSTATE;
  1467.                 start_comment(TRUE);
  1468.                 BEGIN COMMENT; }
  1469.     YY_BREAK
  1470. case 79:
  1471. YY_USER_ACTION
  1472. # line 282 "/lex.l"
  1473. {
  1474.                 yyless(yyleng-1);
  1475.                 comment_caller = YYSTATE;
  1476.                 start_comment(TRUE);
  1477.                 BEGIN COMMENT; }
  1478.     YY_BREAK
  1479. case 80:
  1480. YY_USER_ACTION
  1481. # line 288 "/lex.l"
  1482. case 81:
  1483. YY_USER_ACTION
  1484. # line 288 "/lex.l"
  1485. BEGIN COMMENT;
  1486.     YY_BREAK
  1487. case 82:
  1488. YY_USER_ACTION
  1489. # line 289 "/lex.l"
  1490. { yyless(yyleng-1); BEGIN COMMENT; }
  1491.     YY_BREAK
  1492. case 83:
  1493. YY_USER_ACTION
  1494. # line 290 "/lex.l"
  1495. { yyless(0); BEGIN COMMENT; }
  1496.     YY_BREAK
  1497. case 84:
  1498. YY_USER_ACTION
  1499. # line 291 "/lex.l"
  1500. newline_comment();
  1501.     YY_BREAK
  1502. case 85:
  1503. YY_USER_ACTION
  1504. # line 292 "/lex.l"
  1505. newline_comment();
  1506.     YY_BREAK
  1507. case 86:
  1508. YY_USER_ACTION
  1509. # line 293 "/lex.l"
  1510. {
  1511.                 yyless(yyleng-1); newline_comment(); }
  1512.     YY_BREAK
  1513. case 87:
  1514. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  1515. yy_c_buf_p = yy_cp -= 1;
  1516. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1517. YY_USER_ACTION
  1518. # line 295 "/lex.l"
  1519. { int ret = end_comment(TRUE);
  1520.                   BEGIN comment_caller;
  1521.                   if (ret)    return ret; }
  1522.     YY_BREAK
  1523. case 88:
  1524. YY_USER_ACTION
  1525. # line 298 "/lex.l"
  1526. { int ret = end_comment(FALSE);
  1527.                   BEGIN comment_caller;
  1528.                   if (ret)    return ret; }
  1529.     YY_BREAK
  1530. case 89:
  1531. YY_USER_ACTION
  1532. # line 302 "/lex.l"
  1533. case 90:
  1534. YY_USER_ACTION
  1535. # line 303 "/lex.l"
  1536. case 91:
  1537. YY_USER_ACTION
  1538. # line 303 "/lex.l"
  1539. add_comment(yytext);
  1540.     YY_BREAK
  1541. case 92:
  1542. YY_USER_ACTION
  1543. # line 304 "/lex.l"
  1544. { newline_comment(); BEGIN COMMLINE; }
  1545.     YY_BREAK
  1546. case 93:
  1547. YY_USER_ACTION
  1548. # line 306 "/lex.l"
  1549. {
  1550.                 comment_caller = YYSTATE;
  1551.                 start_comment(FALSE);
  1552.                 BEGIN CPPCOMMENT; }
  1553.     YY_BREAK
  1554. case 94:
  1555. YY_USER_ACTION
  1556. # line 310 "/lex.l"
  1557. {
  1558.                 comment_caller = YYSTATE;
  1559.                 start_comment(TRUE);
  1560.                 BEGIN CPPCOMMENT; }
  1561.     YY_BREAK
  1562. case 95:
  1563. YY_USER_ACTION
  1564. # line 314 "/lex.l"
  1565. add_comment(yytext);
  1566.     YY_BREAK
  1567. case 96:
  1568. YY_USER_ACTION
  1569. # line 315 "/lex.l"
  1570. newline_comment();
  1571.     YY_BREAK
  1572. case 97:
  1573. YY_USER_ACTION
  1574. # line 316 "/lex.l"
  1575. { int ret = end_comment(TRUE);
  1576.                   ++line_num;
  1577.                   BEGIN comment_caller;
  1578.                   if (ret)    return ret; }
  1579.     YY_BREAK
  1580. case 98:
  1581. YY_USER_ACTION
  1582. # line 321 "/lex.l"
  1583. ;
  1584.     YY_BREAK
  1585. case 99:
  1586. YY_USER_ACTION
  1587. # line 322 "/lex.l"
  1588. ++line_num;
  1589.     YY_BREAK
  1590. case 100:
  1591. YY_USER_ACTION
  1592. # line 324 "/lex.l"
  1593. {
  1594.                 output_error();
  1595.                 fprintf(stderr, "bad character '%c'\n", yytext[0]);
  1596.             }
  1597.     YY_BREAK
  1598. case 101:
  1599. YY_USER_ACTION
  1600. # line 328 "/lex.l"
  1601. ECHO;
  1602.     YY_BREAK
  1603. case YY_STATE_EOF(INITIAL):
  1604. case YY_STATE_EOF(CPP1):
  1605. case YY_STATE_EOF(INIT1):
  1606. case YY_STATE_EOF(INIT2):
  1607. case YY_STATE_EOF(CURLY):
  1608. case YY_STATE_EOF(SQUARE):
  1609. case YY_STATE_EOF(LEXYACC):
  1610. case YY_STATE_EOF(SKIP):
  1611. case YY_STATE_EOF(COMMENT):
  1612. case YY_STATE_EOF(COMMLINE):
  1613. case YY_STATE_EOF(CPPCOMMENT):
  1614.     yyterminate();
  1615.  
  1616.     case YY_END_OF_BUFFER:
  1617.         {
  1618.         /* Amount of text matched not including the EOB char. */
  1619.         int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;
  1620.  
  1621.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1622.         *yy_cp = yy_hold_char;
  1623.  
  1624.         if ( yy_current_buffer->yy_input_file != yyin )
  1625.             {
  1626.             /* This can happen if we scan a file, yywrap() returns
  1627.              * 1, and then later the user points yyin at a new
  1628.              * file to resume scanning.  We have to assure
  1629.              * consistency between yy_current_buffer and our
  1630.              * globals.  Here is the right place to do so, because
  1631.              * this is the first action (other than possibly a
  1632.              * back-up) that will match for the new input file.
  1633.              */
  1634.             yy_current_buffer->yy_input_file = yyin;
  1635.             yy_n_chars = yy_current_buffer->yy_n_chars;
  1636.             }
  1637.  
  1638.         /* Note that here we test for yy_c_buf_p "<=" to the position
  1639.          * of the first EOB in the buffer, since yy_c_buf_p will
  1640.          * already have been incremented past the NUL character
  1641.          * (since all states make transitions on EOB to the
  1642.          * end-of-buffer state).  Contrast this with the test
  1643.          * in input().
  1644.          */
  1645.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1646.             { /* This was really a NUL. */
  1647.             yy_state_type yy_next_state;
  1648.  
  1649.             yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  1650.  
  1651.             yy_current_state = yy_get_previous_state();
  1652.  
  1653.             /* Okay, we're now positioned to make the NUL
  1654.              * transition.  We couldn't have
  1655.              * yy_get_previous_state() go ahead and do it
  1656.              * for us because it doesn't know how to deal
  1657.              * with the possibility of jamming (and we don't
  1658.              * want to build jamming into it because then it
  1659.              * will run more slowly).
  1660.              */
  1661.  
  1662.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  1663.  
  1664.             yy_bp = yytext_ptr + YY_MORE_ADJ;
  1665.  
  1666.             if ( yy_next_state )
  1667.                 {
  1668.                 /* Consume the NUL. */
  1669.                 yy_cp = ++yy_c_buf_p;
  1670.                 yy_current_state = yy_next_state;
  1671.                 goto yy_match;
  1672.                 }
  1673.  
  1674.             else
  1675.                 {
  1676.                 goto yy_find_action;
  1677.                 }
  1678.             }
  1679.  
  1680.         else switch ( yy_get_next_buffer() )
  1681.             {
  1682.             case EOB_ACT_END_OF_FILE:
  1683.                 {
  1684.                 yy_did_buffer_switch_on_eof = 0;
  1685.  
  1686.                 if ( yywrap() )
  1687.                     {
  1688.                     /* Note: because we've taken care in
  1689.                      * yy_get_next_buffer() to have set up
  1690.                      * yytext, we can now set up
  1691.                      * yy_c_buf_p so that if some total
  1692.                      * hoser (like flex itself) wants to
  1693.                      * call the scanner after we return the
  1694.                      * YY_NULL, it'll still work - another
  1695.                      * YY_NULL will get returned.
  1696.                      */
  1697.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  1698.  
  1699.                     yy_act = YY_STATE_EOF(YY_START);
  1700.                     goto do_action;
  1701.                     }
  1702.  
  1703.                 else
  1704.                     {
  1705.                     if ( ! yy_did_buffer_switch_on_eof )
  1706.                         YY_NEW_FILE;
  1707.                     }
  1708.                 break;
  1709.                 }
  1710.  
  1711.             case EOB_ACT_CONTINUE_SCAN:
  1712.                 yy_c_buf_p =
  1713.                     yytext_ptr + yy_amount_of_matched_text;
  1714.  
  1715.                 yy_current_state = yy_get_previous_state();
  1716.  
  1717.                 yy_cp = yy_c_buf_p;
  1718.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1719.                 goto yy_match;
  1720.  
  1721.             case EOB_ACT_LAST_MATCH:
  1722.                 yy_c_buf_p =
  1723.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  1724.  
  1725.                 yy_current_state = yy_get_previous_state();
  1726.  
  1727.                 yy_cp = yy_c_buf_p;
  1728.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1729.                 goto yy_find_action;
  1730.             }
  1731.         break;
  1732.         }
  1733.  
  1734.     default:
  1735.         YY_FATAL_ERROR(
  1736.             "fatal flex scanner internal error--no action found" );
  1737.     } /* end of action switch */
  1738.         } /* end of scanning one token */
  1739.     } /* end of yylex */
  1740.  
  1741.  
  1742. /* yy_get_next_buffer - try to read in a new buffer
  1743.  *
  1744.  * Returns a code representing an action:
  1745.  *    EOB_ACT_LAST_MATCH -
  1746.  *    EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1747.  *    EOB_ACT_END_OF_FILE - end of file
  1748.  */
  1749.  
  1750. static int yy_get_next_buffer()
  1751.     {
  1752.     register char *dest = yy_current_buffer->yy_ch_buf;
  1753.     register char *source = yytext_ptr - 1; /* copy prev. char, too */
  1754.     register int number_to_move, i;
  1755.     int ret_val;
  1756.  
  1757.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  1758.         YY_FATAL_ERROR(
  1759.         "fatal flex scanner internal error--end of buffer missed" );
  1760.  
  1761.     if ( yy_current_buffer->yy_fill_buffer == 0 )
  1762.         { /* Don't try to fill the buffer, so this is an EOF. */
  1763.         if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  1764.             {
  1765.             /* We matched a singled characater, the EOB, so
  1766.              * treat this as a final EOF.
  1767.              */
  1768.             return EOB_ACT_END_OF_FILE;
  1769.             }
  1770.  
  1771.         else
  1772.             {
  1773.             /* We matched some text prior to the EOB, first
  1774.              * process it.
  1775.              */
  1776.             return EOB_ACT_LAST_MATCH;
  1777.             }
  1778.         }
  1779.  
  1780.     /* Try to read more data. */
  1781.  
  1782.     /* First move last chars to start of buffer. */
  1783.     number_to_move = yy_c_buf_p - yytext_ptr;
  1784.  
  1785.     for ( i = 0; i < number_to_move; ++i )
  1786.         *(dest++) = *(source++);
  1787.  
  1788.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  1789.         /* don't do the read, it's not guaranteed to return an EOF,
  1790.          * just force an EOF
  1791.          */
  1792.         yy_n_chars = 0;
  1793.  
  1794.     else
  1795.         {
  1796.         int num_to_read =
  1797.             yy_current_buffer->yy_buf_size - number_to_move - 1;
  1798.  
  1799.         while ( num_to_read <= 0 )
  1800.             { /* Not enough room in the buffer - grow it. */
  1801. #ifdef YY_USES_REJECT
  1802.             YY_FATAL_ERROR(
  1803. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1804. #else
  1805.  
  1806.             /* just a shorter name for the current buffer */
  1807.             YY_BUFFER_STATE b = yy_current_buffer;
  1808.  
  1809.             int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;
  1810.  
  1811.             b->yy_buf_size *= 2;
  1812.             b->yy_ch_buf = (char *)
  1813.                 yy_flex_realloc( (void *) b->yy_ch_buf,
  1814.                          b->yy_buf_size );
  1815.  
  1816.             if ( ! b->yy_ch_buf )
  1817.                 YY_FATAL_ERROR(
  1818.                 "fatal error - scanner input buffer overflow" );
  1819.  
  1820.             yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1821.  
  1822.             num_to_read = yy_current_buffer->yy_buf_size -
  1823.                         number_to_move - 1;
  1824. #endif
  1825.             }
  1826.  
  1827.         if ( num_to_read > YY_READ_BUF_SIZE )
  1828.             num_to_read = YY_READ_BUF_SIZE;
  1829.  
  1830.         /* Read in more data. */
  1831.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1832.             yy_n_chars, num_to_read );
  1833.         }
  1834.  
  1835.     if ( yy_n_chars == 0 )
  1836.         {
  1837.         if ( number_to_move - YY_MORE_ADJ == 1 )
  1838.             {
  1839.             ret_val = EOB_ACT_END_OF_FILE;
  1840.             yyrestart( yyin );
  1841.             }
  1842.  
  1843.         else
  1844.             {
  1845.             ret_val = EOB_ACT_LAST_MATCH;
  1846.             yy_current_buffer->yy_eof_status = EOF_PENDING;
  1847.             }
  1848.         }
  1849.  
  1850.     else
  1851.         ret_val = EOB_ACT_CONTINUE_SCAN;
  1852.  
  1853.     yy_n_chars += number_to_move;
  1854.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1855.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1856.  
  1857.     /* yytext begins at the second character in yy_ch_buf; the first
  1858.      * character is the one which preceded it before reading in the latest
  1859.      * buffer; it needs to be kept around in case it's a newline, so
  1860.      * yy_get_previous_state() will have with '^' rules active.
  1861.      */
  1862.  
  1863.     yytext_ptr = &yy_current_buffer->yy_ch_buf[1];
  1864.  
  1865.     return ret_val;
  1866.     }
  1867.  
  1868.  
  1869. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1870.  
  1871. static yy_state_type yy_get_previous_state()
  1872.     {
  1873.     register yy_state_type yy_current_state;
  1874.     register char *yy_cp;
  1875.  
  1876.     register char *yy_bp = yytext_ptr;
  1877.  
  1878.     yy_current_state = yy_start;
  1879.     if ( yy_bp[-1] == '\n' )
  1880.         ++yy_current_state;
  1881.  
  1882.     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1883.         {
  1884.         register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1885.         if ( yy_accept[yy_current_state] )
  1886.             {
  1887.             yy_last_accepting_state = yy_current_state;
  1888.             yy_last_accepting_cpos = yy_cp;
  1889.             }
  1890.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1891.             {
  1892.             yy_current_state = (int) yy_def[yy_current_state];
  1893.             if ( yy_current_state >= 429 )
  1894.                 yy_c = yy_meta[(unsigned int) yy_c];
  1895.             }
  1896.         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1897.         }
  1898.  
  1899.     return yy_current_state;
  1900.     }
  1901.  
  1902.  
  1903. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1904.  *
  1905.  * synopsis
  1906.  *    next_state = yy_try_NUL_trans( current_state );
  1907.  */
  1908.  
  1909. #ifdef YY_USE_PROTOS
  1910. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  1911. #else
  1912. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1913. yy_state_type yy_current_state;
  1914. #endif
  1915.     {
  1916.     register int yy_is_jam;
  1917.     register char *yy_cp = yy_c_buf_p;
  1918.  
  1919.     register YY_CHAR yy_c = 1;
  1920.     if ( yy_accept[yy_current_state] )
  1921.         {
  1922.         yy_last_accepting_state = yy_current_state;
  1923.         yy_last_accepting_cpos = yy_cp;
  1924.         }
  1925.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1926.         {
  1927.         yy_current_state = (int) yy_def[yy_current_state];
  1928.         if ( yy_current_state >= 429 )
  1929.             yy_c = yy_meta[(unsigned int) yy_c];
  1930.         }
  1931.     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1932.     yy_is_jam = (yy_current_state == 428);
  1933.  
  1934.     return yy_is_jam ? 0 : yy_current_state;
  1935.     }
  1936.  
  1937.  
  1938. #ifdef YY_USE_PROTOS
  1939. static void yyunput( int c, register char *yy_bp )
  1940. #else
  1941. static void yyunput( c, yy_bp )
  1942. int c;
  1943. register char *yy_bp;
  1944. #endif
  1945.     {
  1946.     register char *yy_cp = yy_c_buf_p;
  1947.  
  1948.     /* undo effects of setting up yytext */
  1949.     *yy_cp = yy_hold_char;
  1950.  
  1951.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1952.         { /* need to shift things up to make room */
  1953.         /* +2 for EOB chars. */
  1954.         register int number_to_move = yy_n_chars + 2;
  1955.         register char *dest = &yy_current_buffer->yy_ch_buf[
  1956.                     yy_current_buffer->yy_buf_size + 2];
  1957.         register char *source =
  1958.                 &yy_current_buffer->yy_ch_buf[number_to_move];
  1959.  
  1960.         while ( source > yy_current_buffer->yy_ch_buf )
  1961.             *--dest = *--source;
  1962.  
  1963.         yy_cp += dest - source;
  1964.         yy_bp += dest - source;
  1965.         yy_n_chars = yy_current_buffer->yy_buf_size;
  1966.  
  1967.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1968.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1969.         }
  1970.  
  1971.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  1972.         yy_cp[-2] = '\n';
  1973.  
  1974.     *--yy_cp = (char) c;
  1975.  
  1976.  
  1977.     /* Note: the formal parameter *must* be called "yy_bp" for this
  1978.      * macro to now work correctly.
  1979.      */
  1980.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  1981.     }
  1982.  
  1983.  
  1984. #ifdef __cplusplus
  1985. static int yyinput()
  1986. #else
  1987. static int input()
  1988. #endif
  1989.     {
  1990.     int c;
  1991.  
  1992.     *yy_c_buf_p = yy_hold_char;
  1993.  
  1994.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1995.         {
  1996.         /* yy_c_buf_p now points to the character we want to return.
  1997.          * If this occurs *before* the EOB characters, then it's a
  1998.          * valid NUL; if not, then we've hit the end of the buffer.
  1999.          */
  2000.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  2001.             /* This was really a NUL. */
  2002.             *yy_c_buf_p = '\0';
  2003.  
  2004.         else
  2005.             { /* need more input */
  2006.             yytext_ptr = yy_c_buf_p;
  2007.             ++yy_c_buf_p;
  2008.  
  2009.             switch ( yy_get_next_buffer() )
  2010.                 {
  2011.                 case EOB_ACT_END_OF_FILE:
  2012.                     {
  2013.                     if ( yywrap() )
  2014.                         {
  2015.                         yy_c_buf_p =
  2016.                         yytext_ptr + YY_MORE_ADJ;
  2017.                         return EOF;
  2018.                         }
  2019.  
  2020.                     YY_NEW_FILE;
  2021. #ifdef __cplusplus
  2022.                     return yyinput();
  2023. #else
  2024.                     return input();
  2025. #endif
  2026.                     }
  2027.  
  2028.                 case EOB_ACT_CONTINUE_SCAN:
  2029.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  2030.                     break;
  2031.  
  2032.                 case EOB_ACT_LAST_MATCH:
  2033. #ifdef __cplusplus
  2034.                     YY_FATAL_ERROR(
  2035.                     "unexpected last match in yyinput()" );
  2036. #else
  2037.                     YY_FATAL_ERROR(
  2038.                     "unexpected last match in input()" );
  2039. #endif
  2040.                 }
  2041.             }
  2042.         }
  2043.  
  2044.     c = *yy_c_buf_p;
  2045.     *yy_c_buf_p = '\0';    /* preserve yytext */
  2046.     yy_hold_char = *++yy_c_buf_p;
  2047.  
  2048.     return c;
  2049.     }
  2050.  
  2051.  
  2052. #ifdef YY_USE_PROTOS
  2053. void yyrestart( FILE *input_file )
  2054. #else
  2055. void yyrestart( input_file )
  2056. FILE *input_file;
  2057. #endif
  2058.     {
  2059.     if ( ! yy_current_buffer )
  2060.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  2061.  
  2062.     yy_init_buffer( yy_current_buffer, input_file );
  2063.     yy_load_buffer_state();
  2064.     }
  2065.  
  2066.  
  2067. #ifdef YY_USE_PROTOS
  2068. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  2069. #else
  2070. void yy_switch_to_buffer( new_buffer )
  2071. YY_BUFFER_STATE new_buffer;
  2072. #endif
  2073.     {
  2074.     if ( yy_current_buffer == new_buffer )
  2075.         return;
  2076.  
  2077.     if ( yy_current_buffer )
  2078.         {
  2079.         /* Flush out information for old buffer. */
  2080.         *yy_c_buf_p = yy_hold_char;
  2081.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  2082.         yy_current_buffer->yy_n_chars = yy_n_chars;
  2083.         }
  2084.  
  2085.     yy_current_buffer = new_buffer;
  2086.     yy_load_buffer_state();
  2087.  
  2088.     /* We don't actually know whether we did this switch during
  2089.      * EOF (yywrap()) processing, but the only time this flag
  2090.      * is looked at is after yywrap() is called, so it's safe
  2091.      * to go ahead and always set it.
  2092.      */
  2093.     yy_did_buffer_switch_on_eof = 1;
  2094.     }
  2095.  
  2096.  
  2097. #ifdef YY_USE_PROTOS
  2098. void yy_load_buffer_state( void )
  2099. #else
  2100. void yy_load_buffer_state()
  2101. #endif
  2102.     {
  2103.     yy_n_chars = yy_current_buffer->yy_n_chars;
  2104.     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  2105.     yyin = yy_current_buffer->yy_input_file;
  2106.     yy_hold_char = *yy_c_buf_p;
  2107.     }
  2108.  
  2109.  
  2110. #ifdef YY_USE_PROTOS
  2111. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  2112. #else
  2113. YY_BUFFER_STATE yy_create_buffer( file, size )
  2114. FILE *file;
  2115. int size;
  2116. #endif
  2117.     {
  2118.     YY_BUFFER_STATE b;
  2119.  
  2120.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  2121.  
  2122.     if ( ! b )
  2123.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  2124.  
  2125.     b->yy_buf_size = size;
  2126.  
  2127.     /* yy_ch_buf has to be 2 characters longer than the size given because
  2128.      * we need to put in 2 end-of-buffer characters.
  2129.      */
  2130.     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  2131.  
  2132.     if ( ! b->yy_ch_buf )
  2133.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  2134.  
  2135.     yy_init_buffer( b, file );
  2136.  
  2137.     return b;
  2138.     }
  2139.  
  2140.  
  2141. #ifdef YY_USE_PROTOS
  2142. void yy_delete_buffer( YY_BUFFER_STATE b )
  2143. #else
  2144. void yy_delete_buffer( b )
  2145. YY_BUFFER_STATE b;
  2146. #endif
  2147.     {
  2148.     if ( b == yy_current_buffer )
  2149.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  2150.  
  2151.     yy_flex_free( (void *) b->yy_ch_buf );
  2152.     yy_flex_free( (void *) b );
  2153.     }
  2154.  
  2155.  
  2156. #ifdef YY_USE_PROTOS
  2157. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  2158. #else
  2159. void yy_init_buffer( b, file )
  2160. YY_BUFFER_STATE b;
  2161. FILE *file;
  2162. #endif
  2163.     {
  2164.     b->yy_input_file = file;
  2165.  
  2166.     /* We put in the '\n' and start reading from [1] so that an
  2167.      * initial match-at-newline will be true.
  2168.      */
  2169.  
  2170.     b->yy_ch_buf[0] = '\n';
  2171.     b->yy_n_chars = 1;
  2172.  
  2173.     /* We always need two end-of-buffer characters.  The first causes
  2174.      * a transition to the end-of-buffer state.  The second causes
  2175.      * a jam in that state.
  2176.      */
  2177.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  2178.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  2179.  
  2180.     b->yy_buf_pos = &b->yy_ch_buf[1];
  2181.  
  2182.     b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;
  2183.  
  2184.     b->yy_fill_buffer = 1;
  2185.  
  2186.     b->yy_eof_status = EOF_NOT_SEEN;
  2187.     }
  2188.  
  2189.  
  2190. #ifdef YY_USE_PROTOS
  2191. static void yy_push_state( int new_state )
  2192. #else
  2193. static void yy_push_state( new_state )
  2194. int new_state;
  2195. #endif
  2196.     {
  2197.     if ( yy_start_stack_ptr >= yy_start_stack_depth )
  2198.         {
  2199.         int new_size;
  2200.  
  2201.         yy_start_stack_depth += YY_START_STACK_INCR;
  2202.         new_size = yy_start_stack_depth * sizeof( int );
  2203.  
  2204.         if ( ! yy_start_stack )
  2205.             yy_start_stack = (int *) yy_flex_alloc( new_size );
  2206.  
  2207.         else
  2208.             yy_start_stack = (int *) yy_flex_realloc(
  2209.                     (void *) yy_start_stack, new_size );
  2210.  
  2211.         if ( ! yy_start_stack )
  2212.             YY_FATAL_ERROR(
  2213.             "out of memory expanding start-condition stack" );
  2214.         }
  2215.  
  2216.     yy_start_stack[yy_start_stack_ptr++] = YY_START;
  2217.  
  2218.     BEGIN(new_state);
  2219.     }
  2220.  
  2221.  
  2222. static void yy_pop_state()
  2223.     {
  2224.     if ( --yy_start_stack_ptr < 0 )
  2225.         YY_FATAL_ERROR( "start-condition stack underflow" );
  2226.  
  2227.     BEGIN(yy_start_stack[yy_start_stack_ptr]);
  2228.     }
  2229.  
  2230.  
  2231. static int yy_top_state()
  2232.     {
  2233.     return yy_start_stack[yy_start_stack_ptr - 1];
  2234.     }
  2235.  
  2236.  
  2237. #ifdef YY_USE_PROTOS
  2238. static void yy_fatal_error( const char msg[] )
  2239. #else
  2240. static void yy_fatal_error( msg )
  2241. char msg[];
  2242. #endif
  2243.     {
  2244.     (void) fprintf( stderr, "%s\n", msg );
  2245.     exit( 1 );
  2246.     }
  2247.  
  2248.  
  2249.  
  2250. /* Redefine yyless() so it works in section 3 code. */
  2251.  
  2252. #undef yyless
  2253. #define yyless(n) \
  2254.     do \
  2255.         { \
  2256.         /* Undo effects of setting up yytext. */ \
  2257.         yytext[yyleng] = yy_hold_char; \
  2258.         yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
  2259.         yy_hold_char = *yy_c_buf_p; \
  2260.         *yy_c_buf_p = '\0'; \
  2261.         yyleng = n; \
  2262.         } \
  2263.     while ( 0 )
  2264.  
  2265.  
  2266. /* Internal utility routines. */
  2267.  
  2268. #ifndef yytext_ptr
  2269. #ifdef YY_USE_PROTOS
  2270. static void yy_flex_strcpy( char *s1, const char *s2 )
  2271. #else
  2272. static void yy_flex_strcpy( s1, s2 )
  2273. char *s1;
  2274. const char *s2;
  2275. #endif
  2276.     {
  2277.     while ( (*(s1++) = *(s2++)) )
  2278.         ;
  2279.     }
  2280. #endif
  2281.  
  2282.  
  2283. #ifdef YY_USE_PROTOS
  2284. static void *yy_flex_alloc( unsigned int size )
  2285. #else
  2286. static void *yy_flex_alloc( size )
  2287. unsigned int size;
  2288. #endif
  2289.     {
  2290.     return (void *) malloc( size );
  2291.     }
  2292.  
  2293. #ifdef YY_USE_PROTOS
  2294. static void *yy_flex_realloc( void *ptr, unsigned int size )
  2295. #else
  2296. static void *yy_flex_realloc( ptr, size )
  2297. void *ptr;
  2298. unsigned int size;
  2299. #endif
  2300.     {
  2301.     return (void *) realloc( ptr, size );
  2302.     }
  2303.  
  2304. #ifdef YY_USE_PROTOS
  2305. static void yy_flex_free( void *ptr )
  2306. #else
  2307. static void yy_flex_free( ptr )
  2308. void *ptr;
  2309. #endif
  2310.     {
  2311.     free( ptr );
  2312.     }
  2313. # line 328 "/lex.l"
  2314.  
  2315.  
  2316. /* If the matched text contains any new line characters, then update the
  2317.  * current line number.
  2318.  */
  2319. static void
  2320. update_line_num ()
  2321. {
  2322.     char *p = yytext;
  2323.     while (*p != '\0') {
  2324.     if (*p++ == '\n')
  2325.         line_num++;
  2326.     }
  2327. }
  2328.  
  2329. void start_comment(ateol)
  2330. boolean ateol;    /* does comment start at end of an existing line? */
  2331. {
  2332.     comment_remember =    (comment_caller == INITIAL || comment_caller == SKIP) &&
  2333.             (inbasefile || enum_state == BRACES);
  2334.  
  2335.     if (comment_remember)
  2336.     {
  2337.     comment_ateol = ateol;
  2338.     comment_newlines = 0;
  2339.     comment_started = FALSE;
  2340.     new_dynbuf();
  2341.     }
  2342. }
  2343.  
  2344. int end_comment(ateol)
  2345. boolean ateol;    /* does comment end at end of line? */
  2346. {
  2347.     if (comment_remember)
  2348.     {
  2349.     if (!ateol)    comment_ateol = FALSE;
  2350.     yylval.text = return_dynbuf();
  2351.     if (yylval.text[0] == '\0')
  2352.     {
  2353.         free(yylval.text);
  2354.         return 0;
  2355.     }
  2356. #ifdef DEBUG
  2357.     fprintf(stderr,"`%s'\n", yylval.text);
  2358. #endif
  2359.     return comment_ateol ? T_EOLCOMMENT : T_COMMENT;
  2360.     }
  2361.     return 0;
  2362. }
  2363.  
  2364. /* add a newline to the comment, deferring to remove trailing ones */
  2365. void newline_comment()
  2366. {
  2367.     ++line_num;
  2368.  
  2369.     if (!comment_remember || !comment_started)    return;
  2370.  
  2371.     comment_newlines++;
  2372. }
  2373.  
  2374. /* add some true text to the comment */
  2375. void add_comment(s)
  2376. const char *s;
  2377. {
  2378. #ifdef DEBUG
  2379.     fprintf(stderr,"`%s'\n", s);
  2380. #endif
  2381.     if (!comment_remember)    return;
  2382.  
  2383.     comment_started = TRUE;
  2384.  
  2385.     while (comment_newlines)
  2386.     {
  2387.     add_dynbuf('\n');
  2388.     comment_newlines--;
  2389.     }
  2390.  
  2391.     while(*s)
  2392.     add_dynbuf(*s++);
  2393. }
  2394.  
  2395. /* Scan rest of preprocessor statement.
  2396.  */
  2397. static void
  2398. get_cpp_directive ()
  2399. {
  2400.     int c, lastc = '\0';
  2401.  
  2402.     while ((c = input()) > 0) {
  2403.     switch (c) {
  2404.     case '\n':
  2405.         if (lastc != '\\') {
  2406.         unput(c);
  2407.         BEGIN INITIAL;
  2408.         return;
  2409.         }
  2410.         line_num++;
  2411.         break;
  2412.     case '*':
  2413.         if (lastc == '/')
  2414.         {
  2415.         /* might be able to attach comments to #defines one day */
  2416.         comment_caller = YYSTATE;
  2417.         start_comment(TRUE);
  2418.         BEGIN COMMENT;
  2419.         }
  2420.         break;
  2421.     case '/':
  2422.         if (lastc == '/')
  2423.         {
  2424.         /* might be able to attach comments to #defines one day */
  2425.         comment_caller = YYSTATE;
  2426.         start_comment(TRUE);
  2427.         BEGIN CPPCOMMENT;
  2428.         }
  2429.         break;
  2430.     }
  2431.     lastc = c;
  2432.     }
  2433. }
  2434.  
  2435. /* Process include directive.
  2436.  */
  2437. static void
  2438. do_include (filename, sysinc)
  2439. char *filename;        /* file name */
  2440. int sysinc;        /* 1 = do not search current directory */
  2441. {
  2442.     char path[MAX_TEXT_LENGTH];
  2443.     int i;
  2444.     FILE *fp;
  2445.     IncludeStack *sp;
  2446.  
  2447.     if (inc_depth >= MAX_INC_DEPTH) {
  2448.     output_error();
  2449.     fprintf(stderr, "includes too deeply nested\n");
  2450.     return;
  2451.     }
  2452.  
  2453.     for (i = sysinc != 0; i < num_inc_dir; ++i) {
  2454.      strcpy(path, inc_dir[i]);
  2455.      strcat(path, filename);
  2456.      if ((fp = fopen(path, "r")) != NULL) {
  2457.          sp = inc_stack + inc_depth;
  2458.          sp->file = cur_file;
  2459.          sp->line_num = line_num;
  2460. #ifdef FLEX_SCANNER
  2461.          sp->buffer = YY_CURRENT_BUFFER;
  2462.          yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
  2463. #else
  2464.          sp->fp = yyin;
  2465.          yyin = fp;
  2466. #endif
  2467.          ++inc_depth;
  2468.          cur_file = strduplicate(filename);
  2469.          line_num = 0;
  2470.          return;
  2471.      }
  2472.     }
  2473. }
  2474.  
  2475. /* returns TRUE if the basefile status has changed */
  2476. static boolean process_line_directive(new_file)
  2477. const char *new_file;
  2478. {
  2479.     boolean new_stdin;
  2480.  
  2481.     /* strip leading ./ that Sun acc prepends */
  2482.     if (!strncmp(new_file,"./",2))
  2483.     new_file += 2;
  2484.  
  2485.     new_stdin = new_file[0] == '\0' || !strcmp(new_file,"stdin");
  2486.  
  2487.     /* return BASEFILE token only when file changes */
  2488.     if ((cur_file == NULL && !new_stdin) ||
  2489.     (cur_file != NULL &&strcmp(cur_file, new_file)))
  2490.     {
  2491.     safe_free(cur_file);
  2492.     cur_file = new_stdin ? NULL : strduplicate(new_file);
  2493.     yylval.boolean = basefile ? !strcmp(cur_file,basefile) :
  2494.                     cur_file == basefile;
  2495.     return TRUE;
  2496.     }
  2497.     return FALSE;
  2498. }
  2499.  
  2500. /* When the end of the current input file is reached, pop any
  2501.  * nested includes.
  2502.  */
  2503. int
  2504. yywrap ()
  2505. {
  2506.     IncludeStack *sp;
  2507.  
  2508.     if (inc_depth > 0) {
  2509.     --inc_depth;
  2510.     sp = inc_stack + inc_depth;
  2511.     fclose(yyin);
  2512. #ifdef FLEX_SCANNER
  2513.     yy_delete_buffer(YY_CURRENT_BUFFER);
  2514.     yy_switch_to_buffer(sp->buffer);
  2515. #else
  2516.     yyin = sp->fp;
  2517. #endif
  2518.     safe_free(cur_file);
  2519.     cur_file = sp->file;
  2520.     line_num = sp->line_num + 1;
  2521.     return 0;
  2522.     } else {
  2523.     return 1;
  2524.     }
  2525. }
  2526.  
  2527.  
  2528. static void new_dynbuf()
  2529. {
  2530.     if ((dynbuf = malloc(dynbuf_size = DYNBUF_ALLOC)) == 0)
  2531.     outmem();
  2532.     
  2533.     dynbuf_current = 0;
  2534. }
  2535.  
  2536. static void add_dynbuf(c)
  2537. int c;
  2538. {
  2539.     if (dynbuf_current == dynbuf_size &&
  2540.     ((dynbuf = realloc(dynbuf,dynbuf_size += DYNBUF_ALLOC)) == 0))
  2541.         outmem();
  2542.     
  2543.     dynbuf[dynbuf_current++] = c;
  2544. }
  2545.  
  2546. static char *return_dynbuf()
  2547. {
  2548.     add_dynbuf('\0');
  2549.  
  2550.     /* chop it back to size */
  2551.     if ((dynbuf = realloc(dynbuf,dynbuf_current)) == 0)
  2552.     outmem();
  2553.  
  2554.     return dynbuf;    
  2555. }
  2556.  
  2557. /* Output an error message along with the current line number in the
  2558.  * source file.
  2559.  */
  2560. void
  2561. output_error ()
  2562. {
  2563.     errors++;
  2564.     fprintf(stderr, "%s:%d: ", cur_file ? cur_file : "stdin", line_num);
  2565. }
  2566.